import request from '@/utils/request'

export function organizationTree() { //组织机构-树
  return request({
    url: '/sys-center/api/system/dept/tree',
    method: 'get',
  })
}
export function organizationTreeUser(data) { //根据角色id查询组织机构
  return request({
    url: '/sys-center/api/system/roles/powerDept',
    method: 'post',
    data
  })
}

export function organizationTreeNot() { //组织机构-树(不包含禁用)
  return request({
    url: '/sys-center/api/system/dept/tree-not',
    method: 'get',
  })
}

export function organizationList(data) { //组织机构-列表
  return request({
    url: '/sys-center/api/system/depts',
    method: 'post',
    data
  })
}


export function organizationAdd(data) { //组织机构-新增
  return request({
    url: '/sys-center/api/system/dept',
    method: 'post',
    data
  })
}

//原 put
export function organizationEdit(data) { //组织机构-编辑
  return request({
    url: '/sys-center/api/system/put/dept',
    method: 'post',
    data
  })
}

//原 del
export function organizationDelete(id) { //组织机构-删除
  return request({
    url: '/sys-center/api/system/dept/del/'+id,
    method: 'get',

  })
}


export function organizationDetails(id) { //组织机构-详情
  return request({
    url: '/sys-center/api/system/dept/' + id,
    method: 'get',
  })
}